﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
namespace WebClient
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                WebRequest wr = HttpWebRequest.Create(args[0]);
                if (args.Length == 2)
                {
                    wr.Timeout = Convert.ToInt32(args[1]) * 1000;
                }
                using (WebResponse response = wr.GetResponse())
                {                    
                    Stream dataStream = response.GetResponseStream();
                    StreamReader reader = new StreamReader(dataStream);
                    Console.WriteLine(reader.ReadToEnd());
                    reader.Close();
                    response.Close();
                }
            }
        }
    }
}
